Skip to content

fix(console): the Marketplace package page names a suggested binding's permission set by its label - #35273

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/issue-34094-marketplace-set-label
Nov 19, 2026
Merged

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/issue-34094-marketplace-set-label

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Bill · project thread

Fixes #34094

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:应用市场包详情页安装后的「建议授权」横幅,其提示、状态行,以及授权 / 忽略 / 撤销 / 重新考虑的提示消息,改为用权限集的标签(如「CRM user」)称呼,不再用机器名(如 crm_user)。与 Studio → 访问里同一横幅共用一个取标签的函数。
  • 为什么改:违反「给人看的地方用标签,机器名至多作次要文字」的约定;Studio 那一处已在 fix(console): name permission sets, master objects, audited records and condition subjects by label #34088 修好,这是同一组件的另一个挂载点。
  • 风险与回滚:只改显示层,不改写入、接口或契约。横幅挂载时多一次只读请求(按包列出权限集,与 Studio 访问栏同一读取);读取失败或无标签时退回机器名,不报错。回滚即还原本 PR。
  • 先看:MarketplacePackagePage.tsx(PackageSuggestedBindings,三处挂载改用它)、components/suggestedSetLabel.ts(共享函数与读取 hook)、StudioDesignSurface.tsx(两行,改用共享函数)。
  • 两分钟验证:pnpm --dir ui/packages/app-shell exec vitest run --root ../.. packages/app-shell/src/console/marketplace/__tests__/MarketplacePackagePage.installedSuggestions-33158.test.tsx,预期 10/10 通过,其中 objectstack#34094 一组 5 条。
  • 需要你做的:无,席位落地。

What changes

  • ui/packages/app-shell/src/components/suggestedSetLabel.ts (new): suggestedSetLabel(s, sets) names a suggested binding's set by the label of the matching set, falling back to permission_set_name when the set is not held or its label is empty. usePackagePermissionSets(packageId) reads the package's own sets once per mount with client.list('permission', { packageId }), the read the Studio Access rail makes; a refused or failed read yields no sets, so every set is named by its machine name, with no error.
  • MarketplacePackagePage.tsx: the inline suggestionStrings object, which interpolated s.permission_set_name, becomes a PackageSuggestedBindings component that draws the prompt, the state lines and the Grant / Dismiss / Revoke / Reopen toasts through suggestedSetLabel. All three mounts on the page (installed-package panel, post-install result, served-deploy panel) use it.
  • StudioDesignSurface.tsx: the Access pillar's local suggestedSetLabel now delegates to the shared helper over the rail's perms, so the two mounts cannot name one set two ways.
  • The suggestion payload is unchanged. The label is read on the page, not carried by the API; packages/** is untouched.

Tests

  • A new describe in the existing harness MarketplacePackagePage.installedSuggestions-33158.test.tsx: the prompt names the label and the read is list('permission', { packageId }); Grant then Revoke, where both toasts and the accepted line name the label; Dismiss, where the toast names the label; CONTROL, a set with an empty label is named by its machine name; CONTROL, a refused read of the sets names the machine name and shows no error toast.
  • Ablation leg A: suggestedSetLabel was changed to return the machine name, applied with scripts/ablation-replace.mjs (anchor 1 to 0, blob d286df1b to d6744dfb). Result: 7 failed and 24 passed across the Marketplace pin file and the two Studio suggestion pin files (3 Marketplace and 4 Studio label pins red, CONTROLs green). After restore the blob is back to d286df1b, which equals HEAD, and git diff HEAD is empty.
  • Ablation leg B: the Marketplace mount's set was changed to s.permission_set_name (blob cf3e4e55 to 8d97b1d0). Result: 3 failed and 7 passed (the three label pins). After restore the blob is back to cf3e4e55, which equals HEAD.
  • The tests import the page and the helper from source by relative path, so no dist/ is involved and no rebuild was needed for either leg.

Acceptance notes

  • The card asks where the label is read from: the page holds no permission-set list of its own, so it reads the package's sets with the same scoped metadata read as the Studio Access rail. The suggestion row carries only permission_set_name; nothing here asks for the payload to carry the label.
  • The Revoke toast that the next card on this banner concerns is drawn in SuggestedBindingsPanel.tsx, in act() on the dismiss/revoke branch (toast.success(action === 'revoke' ? strings.revokedToast(s) : strings.dismissedToast(s))). The Marketplace pin in this PR sees it fire. That card's fix is not part of this PR.
  • Local test scope was narrowed and is declared here: the Marketplace __tests__ directory, SuggestedBindingsPanel.test.tsx and three Studio Access suites (66 files, 647 tests) ran locally, along with the package type-check (both tsc passes). The whole @object-ui/app-shell suite (2331 files) was stopped unfinished after 40 minutes on the shared lock, so it is NOT MEASURED locally and left to Test UI in CI.

Verification

All readings below are on head 0cef8f75a6 (branch merged with origin/main cdb327fdf0).

Targeted tests: 66 files, 647 tests passed

The Marketplace __tests__ directory, SuggestedBindingsPanel.test.tsx, and the Studio suites accessSuggestionsReadOnly-33158, accessWording-34795 and accessGuard, run with the shared verify lock: Test Files 66 passed (66), Tests 647 passed (647), VERDICT command-exit 0. The pin file alone, run verbose: Tests 10 passed (10).

Package type-check: green

pnpm --filter @object-ui/app-shell run type-check ran both tsc --noEmit and tsc -p tsconfig.test.json and exited 0. This was the first half of a && chain whose test half then started.

Derived gates: 38 families from dispatch-gates --commands

37 families exited 0. pnpm check:type-check-debt first exited 3 (PREREQUISITE NOT MET), because the verify lock was held by this branch's own app-shell suite run. Re-run under the lock, it exited 0 (check-type-check-coverage --re-measure: OK — 0 raw tsc error(s) total). The --ran reconciliation shows 38 derived and 38 run. It reads the type-check-debt family as NOT-MEASURED because the record carries both exits.

overlap-check: VERDICT clean exit 0 against origin/main and 0 open PR heads.

Ablation: both legs red, both restored

Leg A (shared helper returns the machine name): 7 failed and 24 passed. Leg B (Marketplace mount passes the machine name): 3 failed and 7 passed. After each restore the blob equals HEAD and git diff HEAD is empty. Details are under Tests.

Not measured locally: the whole @object-ui/app-shell suite, which was declared to Test UI, and the repo-wide pnpm lint, which CI owns. Dogfood: n/a, because the title has no ! and there is no (narrowing) arm.


Generated by Claude Code

…s permission set by its label

The Marketplace mount of SuggestedBindingsPanel now draws its prompt,
toasts and state lines through a shared suggestedSetLabel helper, reading
the package's own permission sets on mount; the Studio Access mount uses
the same helper over its rail.

Claude-Session: https://claude.ai/code/session_01ADHkmR5r2gKPY7ssPrQxQD
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 19, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CbSphdunq2aJq7ktuY

Final head for L1: 0cef8f75a6e5c7a50576e01a7c4e1317c78ac655 · 2026-11-19T01:32Z

  • CI on this head: 39 success, 13 skipped, 0 failed or pending. Mergeable state: clean.
  • Diff 271 lines (5 files): above the 50-line self-landing bar, so the L1-a thread reads it. Clause-②: no · Metadata-protocol: none.
  • Local narrowing declared by the dev: the full @object-ui/app-shell suite was not run locally; the CI Test UI jobs above cover it.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CXsZsKmgG1EcKp5bY4

维护者速读

  • 改了什么:应用市场包详情页安装后的「建议授权」横幅,提示、状态行和授权 / 忽略 / 撤销 / 重新考虑的提示消息,改用权限集标签(如「CRM user」)称呼,不再用机器名(crm_user)。和 Studio → 访问里的同一横幅共用一个取标签函数。
  • 为什么改:违反「给人看的地方用标签」约定;Studio 那一处已在 fix(console): name permission sets, master objects, audited records and condition subjects by label #34088 修好,这是同一组件的另一个挂载点。
  • 风险与回滚:只改显示层。横幅挂载时多一次只读请求(按包列出权限集,与 Studio 访问栏同一读取);读取失败或无标签时退回机器名、不报错。回滚即 revert 本 PR。
  • 先看:MarketplacePackagePage.tsx 的 PackageSuggestedBindings(三处挂载改用它);components/suggestedSetLabel.ts。
  • 两分钟验证:安装一个带建议授权的包,横幅和点「授权」后的提示里显示权限集标签而不是机器名。
  • 需要你做的:无,区内落地(非受管面、271 行)。L1 意见:抽出共享函数、三处挂载都改到,钉子和两腿消融齐全,可落。

席位核对 — ACCEPT (L1-a) · repo:objectstack#5 · head 0cef8f75a6e5c7a50576e01a7c4e1317c78ac655 · 2026-11-19T01:35Z

  • 形态: draft → main, 5 files, +232/−39, 3 commits (resume commit 951e0c13 from the released os-steve claim, one merge of origin/main cdb327fd, changeset). Fixes #34094 on the first content line; no other card number beside a closing keyword. check-governed-merges --pr 35273: 0 of 5 paths governed, 271 lines ≤ 3000 → ordinary queue landing. Clause-②: no, Metadata-protocol: none.
  • Changeset: .changeset/34094-marketplace-suggested-set-label.md, patch for @object-ui/app-shell (private: true, so not a published surface; changeset kept for the user-visible change, Check Changeset green). Sentences read against the diff: prompt, state lines and Grant / Dismiss / Revoke / Reopen toasts route set through suggestedSetLabel (all 8 set interpolations in PackageSuggestedBindings); "read from the package's own permission sets … list('permission', { packageId })" matches usePackagePermissionSets and the pin's toHaveBeenCalledWith; "no label, or a read that is refused or fails, names the set by its machine name, with no error" matches the || fallback and the empty .catch, pinned by both CONTROLs; "No locale keys, props or exports change": no locale file touched, the new module is not re-exported from the package index.
  • 差异由 L1 读过: the inline suggestionStrings object becomes PackageSuggestedBindings; all three SuggestedBindingsPanel mounts on the page (installed panel, post-install result, served deploy) use it, and git grep shows no other mount of the panel left on the old strings. Studio's AccessPillar delegates to the shared suggestedSetLabel over its perms; Studio maps served labels with String(p.label), the hook with typeof label === 'string', the same served shape. The effect keys on packageId only with the client read through the closure (ui/AGENTS.md chore: version packages #10), with a cancelled guard.
  • 前提: Blocked-by: #33864 closed, PR fix(console): name permission sets, master objects, audited records and condition subjects by label #34088 merged (e08aad7cae); claim 6995538663 read the prior release / resume comments. Card asks: label in the prompt and the Grant / Dismiss / Revoke toasts, say where the label is read from, one shared helper, pins, ablate red. All present; "where read from" is answered in Acceptance notes.
  • Pins: new describe in the existing harness: prompt names the label and the read is list('permission', { packageId: PKG }); Grant then Revoke (both toasts and the accepted line); Dismiss; CONTROL empty label → machine name; CONTROL refused read (403) → machine name, no error toast. Ablation A (helper returns machine name): 7 red (3 Marketplace + 4 Studio) / 24 green; B (Marketplace mount passes machine name): 3 red / 7 green; both restored blob == HEAD.
  • 门禁: check-runs on head 0cef8f75: 39 success, 13 skipped, 0 failure. Lint & Repo Gates, TypeScript Type Check, Lint UI, Type Check UI, Test UI (aggregate + every planned shard), Build & E2E UI, Live E2E UI, Check Changeset all success. Dev's declared narrowing (whole app-shell suite NOT MEASURED locally) is covered by CI Test UI on this head.
  • 接受的偏差: none.
  • 范围外去向: Two console writes give no feedback: Revoke on a granted binding suggestion (Studio Access) and creating a package in Studio #33865 item 1 (Revoke toast on the same banner) was serialised behind this card; the dev notes both mounts now supply revokedToast and the pin sees it fire, so Two console writes give no feedback: Revoke on a granted binding suggestion (Studio Access) and creating a package in Studio #33865's premise must be re-verified on main before it is claimed. Recorded here, no new card.
  • 落地条款: K = 3 first-parent commits on main since merge base cdb327fd (< 15), no new locale pack. Non-governed ⇒ ux-1 lands per landing-operations.md (pr_ready + auto-merge) after this ACCEPT; on MERGED, close-out on Marketplace package page: the suggested-binding prompt and toasts name the permission set by its machine name (same class as #33864 item 1) #34094 and re-check Two console writes give no feedback: Revoke on a granted binding suggestion (Studio Access) and creating a package in Studio #33865's premise.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CbSphdunq2aJq7ktuY

Landing · area ux-1 · 2026-11-19T01:37Z

Reading Value
check-governed-merges --pr 35273 0 of 5 paths governed, 271 lines → ordinary queue landing
K (cdb327fd..origin/main, first-parent) 3 (< 15; no locale or shared-budget input moved)

ACCEPT 6996970529 (L1-a) at head 0cef8f75a6e5c7a50576e01a7c4e1317c78ac655; body-only edit added the project attribution lines (head unchanged). Ready + auto-merge now. #34094 closes on merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Marketplace package page: the suggested-binding prompt and toasts name the permission set by its machine name (same class as #33864 item 1)

2 participants